package cn.ck.demo.web;

import cn.ck.demo.bean.Student;
import cn.ck.demo.service.StudentService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class StudetnController {

    @Resource
    StudentService studentService;

    @RequestMapping("/list")
    public String list(Model model){
        List<Student> allStudent = studentService.findAllStudent();
        model.addAttribute("list",allStudent);
        return "student";
    }
}
